/**
 * @Description:
 * @Author 卞鹏飞 <228443632@qq.com>
 * @create 15/08/24 11:15 AM
 */

import { GET, POST } from '@/api/helper'
import profile from '@root/profile'

const { mock } = profile.proxy

export default {
  /**
   *  债权/债券包详情
   * */
  getBondDetail: (body = { params: {}, data: {}, headers: {} }) => POST({ url: 'http://localhost:7001/user', ...body }),

  /**
   * */
  mockTableData: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/api/zsap-operation-user/oprEmployeeInfo/selectByPage', ...body }),

  /**
   * 更新本地字典ts文件
   */
  updateDictTsFile: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/dict/updateLocalDictTsFile', ...body }),

  /**
   * 更新本地字典ts文件
   * @param {Object} body
   * @param {Object} [body.params]
   * @param {IParameter[]} [body.data]
   * @param {Object} [body.headers]
   * @return {Promise<{code: number, message: string, data: {}}>}
   */
  updateParamTsFile: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/dict/updateLocalParamTsFile', ...body }),

  // 获取用户信息
  getLoginUserInfo: (body = { params: {}, data: {}, headers: {} }) =>
    GET({ url: window.location.pathname + '/mock-data/auth/user-info.json', ...body }),

  // 获取用户多部门信息
  queryBranchByToken: (body = { params: {}, data: {}, headers: {} }) =>
    GET({ url: window.location.pathname + '/mock-data/auth/multi-departs.json', ...body }),

  // 获取用户菜单权限
  queryMenuListByToken: (body = { params: {}, data: {}, headers: {} }) =>
    GET({ url: window.location.pathname + '/mock-data/auth/menus.json', ...body }),

  // 获取用户菜单权限
  projectList: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/api/projectList', ...body }),

  // 系统参数列表
  parameterList: (data) => POST({ url: mock.prefix + '/api/system/parameter/list', data }),

  // 获取用户菜单权限
  dictionaryList: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/api/system/dictionary/list', ...body }),

  // 获取用户菜单权限
  departmentList: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/api/departmentList', ...body }),

  // 获取协商策略列表
  getReliefStrategyInfoByPage: (body = { params: {}, data: {}, headers: {} }) =>
    POST({ url: mock.prefix + '/api/getReliefStrategyInfoByPage', ...body })
}
